home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / progjour / 1991 / 01 / hotkey.prg < prev    next >
Text File  |  1990-11-25  |  2KB  |  50 lines

  1. *** HOTKEY.PRG            && partial code fragment
  2.  
  3. *** a revised version of menukey that supports a HOT-Key to save
  4. *** the current EPA RRN and name to a database called ortemp.dbf
  5. *** with an alias of TMP
  6.  
  7. private m_seekok
  8. m_seekok = .F.
  9.  
  10. ** Add the following option to MENUKEY's main case statement
  11. ** to support a hot-key option
  12.  
  13.                 CASE choice = 22    && insert or CTRL-V
  14.                     m_row = ROW()
  15.                     m_col = COL()
  16.                     m_dbf = dbf()               && save current database
  17.                     m_select = select()         && save current work area
  18.                     m_select = chr(m_select+64) && convert to ascii
  19.                     save screen to m_screen
  20.                     m_temprrn = EPA->>rrn
  21.                     m_tempname = EPA->>name
  22.                     IF .not. m_editflg
  23.                         ?? CHR(7)
  24.                     ENDIF
  25.                     select TMP
  26.                     IF m_editflg .and. m_editidx  && is file indexed by RRN
  27.                         seek m_temprrn
  28.                         if EOF()
  29.                             m_seekok = .F.
  30.                             skip -1
  31.                         else
  32.                             m_seekok = .T.                      
  33.                         endif
  34.                     ENDIF
  35.                     IF .not. m_seekok .or. .not. m_editidx
  36.                         append blank
  37.                         replace TMP->>rrn with m_temprrn
  38.                         replace TMP->>name with m_tempname
  39.                         replace TMP->>rev_date with date()
  40.                     ENDIF
  41.                     IF (m_editflg)
  42.                         edit
  43.                     ENDIF
  44.                     SELECT &m_select.
  45.                     restore screen from m_screen
  46.                     @ m_row, m_col SAY ""    && restore cursor
  47.                     badkey = .T.
  48.                     notfound = .T.
  49.  
  50.